Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

This change addresses an issue where functions expecting a cell array for the 'documents' field would fail. The API returns an empty JSON array, which jsondecode converts to an empty double array ([]). The fix is applied at the source in ndi.cloud.api.implementation.documents.ListDatasetDocuments to ensure all downstream functions receive the correct data type. This is a more robust solution based on user feedback.


PR created automatically by Jules for task 13683842651781816121

Updated `ndi.cloud.api.implementation.documents.ListDatasetDocuments` to robustly convert an empty 'documents' field to an empty cell array. The previous implementation incorrectly checked for an empty struct, whereas the API returns an empty double array for an empty JSON array.

The corrected implementation now checks if the field is empty and not already a cell, ensuring type consistency for all downstream functions.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

@github-actions
Copy link
Contributor

Test Results

381 tests  ±0   377 ✅ ±0   17m 25s ⏱️ -13s
 34 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0   4 🔥 ±0 

For more details on these errors, see this check.

Results for commit 4f3d058. ± Comparison against base commit 6b63521.

google-labs-jules bot and others added 2 commits November 1, 2025 14:02
- Updated `ListDatasetDocuments` and `ListDatasetDocumentsAll` to ensure that an empty 'documents' field is always returned as an empty cell array (`{}`), preventing type mismatch errors in downstream code. A robust check now handles cases where the field is an empty double array from a JSON conversion.

- In `DocumentsTest.m`, wrapped an unformatted error message in the `testBulkUploadAndDownload` method with `ndi.unittest.cloud.APIMessage` for improved readability and consistency with the rest of the test suite.
@stevevanhooser stevevanhooser marked this pull request as ready for review November 1, 2025 14:32
@stevevanhooser stevevanhooser self-requested a review November 1, 2025 14:32
Copy link
Contributor

@stevevanhooser stevevanhooser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bugs fixed

@stevevanhooser stevevanhooser merged commit 5289a57 into main Nov 1, 2025
@stevevanhooser stevevanhooser deleted the fix-empty-documents-field branch November 1, 2025 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants